<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址：https://www.niucloud-admin.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------

use app\api\middleware\ApiChannel;
use app\api\middleware\ApiCheckToken;
use app\api\middleware\ApiLog;
use app\api\middleware\ApiCheckFrequency;
use think\facade\Route;



/**
 * 路由
 */
Route::group(function() {

    /***************************************************** 登录注册 ****************************************************/
    //小程序通过code登录
    Route::post('weapp/login', 'weapp.Weapp/login')->middleware(ApiCheckFrequency::class);
    //小程序通过code注册
    Route::post('weapp/register', 'weapp.Weapp/register')->middleware(ApiCheckFrequency::class);

    //手机号发送验证码
    Route::post('send/mobile/:type', 'login.Login/sendMobileCode')->middleware(ApiCheckFrequency::class);
    //手机号登录
    Route::post('login/mobile', 'login.Login/mobile');
    //会员信息
    Route::post('user/member', 'member.Member/info');
    //会员信息修改
    Route::post('user/member/edit', 'member.Member/edit');

    /***************************************************** 地区管理 ****************************************************/
    //通过pid获取列表
    Route::get('area/list_by_pid/:pid', 'sys.Area/listByPid');
    //通过层级获取列表
    Route::get('area/tree/:level', 'sys.Area/tree');
    // 获取省市县数据根据地址id
    Route::get('area/code/:code', 'sys.Area/areaByAreaCode');


})->middleware(ApiChannel::class)
    ->middleware(ApiCheckToken::class)
    ->middleware(ApiLog::class);

